(module misc mzscheme
  (provide list-of)
  
  (define (list-of func list)
    "list-of takes a function and a list and returns a list of values returned when the function is applied to each item of that list."
    (letrec ((list-of-help
              (lambda (func list so-far)
                (if (null? list)
                    (reverse so-far)
                    (list-of-help func (cdr list) (cons (func (car list)) so-far))))))
      (list-of-help func list '()))))